"""
股票分析应用主文件
重构后的模块化架构
"""
from flask import Flask
from flask_cors import CORS
from config import Config

# 导入路由蓝图
from routes.stock_routes import stock_bp
from routes.system_routes import system_bp

# 创建Flask应用
app = Flask(__name__)
CORS(app)

# 配置应用
app.config['COMPRESS_REGISTER'] = False
app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 0
app.config['SECRET_KEY'] = Config.SECRET_KEY

# 注册蓝图
app.register_blueprint(stock_bp)
app.register_blueprint(system_bp)


if __name__ == '__main__':
    import os
    port = Config.PORT
    app.run(host=Config.HOST, port=port, debug=Config.DEBUG)